package com.cazj.common.util;

import java.io.File;

import org.springframework.util.ResourceUtils;

import com.cazj.common.exception.ServiceException;

public class PathUtil {
	public static String getFilePath() {
		try {
			//获取跟目录
			File rootPath = new File(ResourceUtils.getURL("classpath:").getPath());
			if(!rootPath.exists()) rootPath = new File("");
			//拼接成文件存储的目录
			String uploadPath = rootPath.toString()+"\\static\\file\\";
			return uploadPath;
		} catch (Exception e1) {
			e1.printStackTrace();
			throw new ServiceException("找不到文件目录,请联系管理员");
		}
	}
}
